var speed=5;  
var center=document.getElementById("box");  
var demo1=document.getElementById("demo1");  
var demo2=document.getElementById("demo2");  
  
demo2.innerHTML=demo1.innerHTML;  
  
function scrollToLeft(){  
    if(demo2.offsetLeft-box.scrollLeft<=0){  
        box.scrollLeft-=demo2.offsetWidth;  
    } else {  
        box.scrollLeft++;  
    }  
}  
  
var myMar=setInterval(scrollToLeft,speed);  
box.onmouseover=function(){clearInterval(myMar)};  
box.onmouseout=function(){myMar=setInterval(scrollToLeft,speed)};  